Embedded programming
Objectives of the week
- Compare the performance and development workflows for other architectures
Group assignment
As per the task of group assignments for this week we have distribute the task to individual one which they didnt tried before.
Task Assign:
Comparing family different family architecture:
Sr No. | Parametres | Atmega328p | ESP 32 | Rasberry pi 3 |
1. | Operating Voltage | 5V | 3.3V | 3.3V |
2. | DC current on I/O pins | 40mA | 40mA | 16mA |
3. | Digital I/O pins | 14 | 39 | 26 |
4. | Flash Memory | 32KB | 4MB | 16 Gbytes SSD memory card |
5. | Frequency | 16MHz | 40MHz | 1.2GHz |
6. | Wi-Fi | - | 802.11b/g/n | 802.11b/g/n |
7. | Bluetooth | - | V4.2 | V4.1 |
8. | Microcontroller | ATmega328p | Xtensa LX6 | Broadcom BCM2837 64bit quad core processor |
9. | Architecture | Harvard | Harvard | Harvard |
Specifications of ESP32:
As we have mentioned the features of ESP-32 in above comparision table now here we are going to see the performance of ESP-32 of xtensa family.Actually to test the esp-32 is new to all.But few of the group members wanted to learn and test the ESP-32.So in below video we have shown the blinking LED program in ESP-32.
ESP32 is a series of low-cost, low-power system on a chip microcontrollers with integrated Wi-Fi and dual-mode Bluetooth. The ESP32 series employs a Tensilica Xtensa LX6 microprocessor in both dual-core and single-core variations and includes built-in antenna switches, RF balun, power amplifier, low-noise receive amplifier, filters, and power-management modules. ESP32 is created and developed by Espressif Systems, a Shanghai-based Chinese company, and is manufactured by TSMC using their 40 nm process.
ESP 32 pinout:
Programming Environment:
The ESP32 can be programmed in different programming environments. You can use:
As we are familiar with arduino IDE ,we are using Arduino platform for ESP32 programming.There’s an add-on for the Arduino IDE allows you to program the ESP32 using the Arduino IDE and its programming language.
Copy the URL from github for ESP32 adding in Arduino.Go to Arduino-->File-->preferences and paste your URL.
Open Boards Manager from Tools > Board menu and install esp32 platform
Plug your ESP32 development board to your computer and follow these next instructions:
Go to tools--> Board and select your ESP32 board and also select COM port.
After doing all this ,write your code in arduino and upload it in ESP32 board.As we are doing only LED blinking code.We have written code for it.First compile your code and then upload it.
If you get the following error when trying to upload code, it means that your ESP32 is not in flashing/uploading mode.Failed to connect to ESP32: Timed out... Connecting...To upload code, you need to follow the next steps (make sure you have the right board selected:
That’s it. After uploading the new sketch, you can press the “ENABLE” button to restart the ESP32 and run the new uploaded sketch.
Python GUI – tkinter
Python offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python.
To create a tkinter app:
There are two main methods used which the user needs to remember while creating the Python application with GUI.
Tk(screenName=None, baseName=None, className=’Tk’, useTk=1):
To create a main window, tkinter offers a method ‘Tk(screenName=None, baseName=None, className=’Tk’, useTk=1)’. To change the name of the window, you can change the className to the desired one. The basic code used to create the main window of the application is:
m=tkinter.Tk() where m is the name of the main window object
mainloop(): There is a method known by the name mainloop() is used when your application is ready to run. mainloop() is an infinite loop used to run the application, wait for an event to occur and process the event as long as the window is not closed.
m.mainloop()
There are a number of widgets which you can put in your tkinter application. Some of the major widgets are explained below:
Button:To add a button in your application, this widget is used.The general syntax is:
w=Button(master, option=value)
CheckButton: To select any number of options by displaying a number of options to a user as toggle buttons. The general syntax is:
w = CheckButton(master, option=value)
Entry:It is used to input the single line text entry from the user.. For multi-line text input, Text widget is used. The general syntax is:
w=Entry(master, option=value)
Frame: It acts as a container to hold the widgets. It is used for grouping and organizing the widgets. The general syntax is:
w = Frame(master, option=value) master is the parameter used to represent the parent window.